﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <!-- Defines the items that will make the list box look like a scrollable bar graph -->
    <!-- Each item has 3 components: 
            a colored border whose height corresponds to the Y value,
            underneath that the count is displayed,
            beneath that, the tag is shown
        The tool-tip will be the various Y-Axis candidate values-->
    <DataTemplate x:Key="ListBoxGraphItemTemplate">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="{Binding Path=MaxBarHeight, RelativeSource={RelativeSource AncestorType=Window},FallbackValue=100}" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="100" />
            </Grid.RowDefinitions>
            <Border Background="{Binding BrushColor}" Width="30" Height="{Binding YValue}" VerticalAlignment="Bottom">
                <Border.ToolTip>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="auto" />
                        </Grid.ColumnDefinitions>
                        <Label Content="Avg. Age:" />
                        <TextBlock Grid.Column="1" Text="{Binding AvgAgeInHours, StringFormat=N0}" VerticalAlignment="Center" />

                        <Label Grid.Row="1" Content="Filtered Count:" />
                        <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Count}" VerticalAlignment="Center" />

                        <Label Grid.Row="2" Content="% Allowing Remote:" />
                        <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding PctAllowingRemote, StringFormat=P}" VerticalAlignment="Center" />
                        
                        <Label Grid.Row="3" Content="Avg. # Related Skills/Job:" />
                        <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding AvgNumRelatedSkills, StringFormat=N2}" VerticalAlignment="Center" />
                    </Grid>
                </Border.ToolTip>
            </Border>
            <TextBlock Grid.Row="1" Background="Transparent" Text="{Binding DisplayNumber, StringFormat=N2}" HorizontalAlignment="Center" />
            <TextBlock Grid.Row="2" Text="{Binding Tag}" Margin="0 5" ToolTip="{Binding Tag}">
                <TextBlock.LayoutTransform>
                    <RotateTransform Angle="90" />
                </TextBlock.LayoutTransform>
            </TextBlock>
        </Grid>
    </DataTemplate>
</ResourceDictionary>